home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / a-sequio.ads < prev    next >
Text File  |  1994-05-19  |  4KB  |  89 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                    A D A . S E Q U E N T I A L _ I O                     --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.2 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25.  
  26. with Ada.IO_Exceptions;
  27.  
  28. generic
  29.    type Element_Type (<>) is private;
  30.  
  31. package Ada.Sequential_IO is
  32.  
  33.    type File_Type is limited private;
  34.  
  35.    type File_Mode is (In_File, Out_File, Append_File);
  36.  
  37.    ---------------------
  38.    -- File management --
  39.    ---------------------
  40.  
  41.    procedure Create (File : in out File_Type;
  42.                      Mode : in File_Mode := Out_File;
  43.                      Name : in String := "";
  44.                      Form : in String := "");
  45.  
  46.    procedure Open   (File : in out File_Type;
  47.                      Mode : in File_Mode;
  48.                      Name : in String;
  49.                      Form : in String := "");
  50.  
  51.    procedure Close  (File : in out File_Type);
  52.    procedure Delete (File : in out File_Type);
  53.    procedure Reset  (File : in out File_Type; Mode : in File_Mode);
  54.    procedure Reset  (File : in out File_Type);
  55.  
  56.    function Mode    (File : in File_Type) return File_Mode;
  57.    function Name    (File : in File_Type) return String;
  58.    function Form    (File : in File_Type) return String;
  59.  
  60.    function Is_Open (File : in File_Type) return Boolean;
  61.  
  62.    ---------------------------------
  63.    -- Input and output operations --
  64.    ---------------------------------
  65.  
  66.    procedure Read   (File : in File_Type; Item : out Element_Type);
  67.    procedure Write  (File : in File_Type; Item : in Element_Type);
  68.  
  69.    function End_Of_File (File : in File_Type) return Boolean;
  70.  
  71.    ----------------
  72.    -- Exceptions --
  73.    ----------------
  74.  
  75.    Status_Error : exception renames IO_Exceptions.Status_Error;
  76.    Mode_Error   : exception renames IO_Exceptions.Mode_Error;
  77.    Name_Error   : exception renames IO_Exceptions.Name_Error;
  78.    Use_Error    : exception renames IO_Exceptions.Use_Error;
  79.    Device_Error : exception renames IO_Exceptions.Device_Error;
  80.    End_Error    : exception renames IO_Exceptions.End_Error;
  81.    Data_Error   : exception renames IO_Exceptions.Data_Error;
  82.  
  83. private
  84.    --  Dummy definition for now (body not yet implemented)
  85.  
  86.    type File_Type is new Integer;
  87.  
  88. end Ada.Sequential_IO;
  89.